package com.example.computer_exam_training_sys.service;

import com.example.computer_exam_training_sys.entity.UserWrongQuestionsInfo;
import com.example.computer_exam_training_sys.vo.PageResult;
import com.example.computer_exam_training_sys.vo.QuestionWithPoint;
import com.example.computer_exam_training_sys.vo.UserWrongQuestionWithCourseVO;

import java.util.List;
import com.example.computer_exam_training_sys.vo.UserWrongQuestionWithCourseVO;

public interface UserWrongQuestionsService {
    List<UserWrongQuestionsInfo> findAll();
    List<UserWrongQuestionsInfo> findByUserId(Integer userId);
    List<UserWrongQuestionsInfo> findByQuestionId(Integer questionId);
    int insert(UserWrongQuestionsInfo info);
    int update(UserWrongQuestionsInfo info);
    int softDelete(Integer id);
    int hardDelete(Integer id);
    List<QuestionWithPoint> selectQuestionsWithPointByPointId(Integer pointId);
    List<UserWrongQuestionWithCourseVO> findWrongQuestionsByCourseId(Integer courseId);
    int updateMastered(Integer id, Byte isMastered);
    PageResult<UserWrongQuestionWithCourseVO> queryWrongQuestions(
            Integer userId, // 新增参数
            Integer courseId,
            Integer pointId,
            Integer isMastered,
            Integer sourceType,
            String startTime,
            String endTime,
            Integer page,
            Integer size
    );
    // 批量查询
    List<UserWrongQuestionWithCourseVO> findWrongQuestionsByIds(List<Integer> ids);
    
    // 统计用户不重复的错题数量
    int countDistinctQuestionsByUserId(Integer userId);
}
